<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>


<div class="pro">
    <?php echo validation_errors(); ?>
	<div class="pro-imgs">
		<img src="<?php echo base_url($image); ?>"/>
	</div>
	<div class="pro-info">
	    <?php echo form_open('cart/add');?>
	        <?php echo form_hidden('product_id', $product_id)?>
    		<h3><?php echo $product_name; ?></h3>
    		<hr/>
    		<dl>
    			<dt><?php echo lang('sku');?></dt>
    			<dd><?php echo $sku;?></dd>
    		</dl>
    		<dl>
    			<dt><?php echo lang('price');?></dt>
    			<dd><?php echo $price;?></dd>
    		</dl>
    		<?php foreach($options as &$opt):?>
    			<dl>
    				<dt><?php echo $opt['option_name'];?></dt>
    				<dd>
    					<select name="options[<?php echo $opt['option_id']?>]">
    						<option><?php echo lang('please_select').$opt['option_name'];?></option>
    						<?php foreach ($opt['option_values'] as &$val):?>
    							<option value="<?php echo $val['option_value_id']?>"><?php echo $val['option_value_name'];?></option>
    						<?php endforeach;?>
    					</select>
    				</dd>
    			</dl>
    		<?php endforeach;?>
    		<dl>
    		    <dt>数量:</dt>
    		    <dd><input type="text" name="quantity" value="1"/></dd>
    		</dl>
    		<div class="pro-buy">
    			<button type="submit"><?php echo lang('buy');?></button>
    		</div>
    	</form>
	</div>
</div>
<div class="pro-deac">
	<h3><?php echo lang('product_description');?></h3>
	<p><?php echo $product_description;?></p>
</div>
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>